Integrand size = 22, antiderivative size = 856 \[ \int x^2 \left (a+b \sin \left (c+d (f+g x)^n\right )\right )^2 \, dx=\frac {\left (2 a^2+b^2\right ) f^2 x}{2 g^2}-\frac {\left (2 a^2+b^2\right ) f (f+g x)^2}{2 g^3}+\frac {\left (2 a^2+b^2\right ) (f+g x)^3}{6 g^3}+\frac {i a b e^{i c} f^2 (f+g x) \left (-i d (f+g x)^n\right )^{-1/n} \Gamma \left (\frac {1}{n},-i d (f+g x)^n\right )}{g^3 n}-\frac {i a b e^{-i c} f^2 (f+g x) \left (i d (f+g x)^n\right )^{-1/n} \Gamma \left (\frac {1}{n},i d (f+g x)^n\right )}{g^3 n}+\frac {2^{-2-\frac {1}{n}} b^2 e^{2 i c} f^2 (f+g x) \left (-i d (f+g x)^n\right )^{-1/n} \Gamma \left (\frac {1}{n},-2 i d (f+g x)^n\right )}{g^3 n}+\frac {2^{-2-\frac {1}{n}} b^2 e^{-2 i c} f^2 (f+g x) \left (i d (f+g x)^n\right )^{-1/n} \Gamma \left (\frac {1}{n},2 i d (f+g x)^n\right )}{g^3 n}-\frac {2 i a b e^{i c} f (f+g x)^2 \left (-i d (f+g x)^n\right )^{-2/n} \Gamma \left (\frac {2}{n},-i d (f+g x)^n\right )}{g^3 n}+\frac {2 i a b e^{-i c} f (f+g x)^2 \left (i d (f+g x)^n\right )^{-2/n} \Gamma \left (\frac {2}{n},i d (f+g x)^n\right )}{g^3 n}-\frac {2^{-1-\frac {2}{n}} b^2 e^{2 i c} f (f+g x)^2 \left (-i d (f+g x)^n\right )^{-2/n} \Gamma \left (\frac {2}{n},-2 i d (f+g x)^n\right )}{g^3 n}-\frac {2^{-1-\frac {2}{n}} b^2 e^{-2 i c} f (f+g x)^2 \left (i d (f+g x)^n\right )^{-2/n} \Gamma \left (\frac {2}{n},2 i d (f+g x)^n\right )}{g^3 n}+\frac {i a b e^{i c} (f+g x)^3 \left (-i d (f+g x)^n\right )^{-3/n} \Gamma \left (\frac {3}{n},-i d (f+g x)^n\right )}{g^3 n}-\frac {i a b e^{-i c} (f+g x)^3 \left (i d (f+g x)^n\right )^{-3/n} \Gamma \left (\frac {3}{n},i d (f+g x)^n\right )}{g^3 n}+\frac {2^{-2-\frac {3}{n}} b^2 e^{2 i c} (f+g x)^3 \left (-i d (f+g x)^n\right )^{-3/n} \Gamma \left (\frac {3}{n},-2 i d (f+g x)^n\right )}{g^3 n}+\frac {2^{-2-\frac {3}{n}} b^2 e^{-2 i c} (f+g x)^3 \left (i d (f+g x)^n\right )^{-3/n} \Gamma \left (\frac {3}{n},2 i d (f+g x)^n\right )}{g^3 n} \]
1/2*(2*a^2+b^2)*f^2*x/g^2-1/2*(2*a^2+b^2)*f*(g*x+f)^2/g^3+1/6*(2*a^2+b^2)* (g*x+f)^3/g^3+I*a*b*exp(I*c)*f^2*(g*x+f)*GAMMA(1/n,-I*d*(g*x+f)^n)/g^3/n/( (-I*d*(g*x+f)^n)^(1/n))-I*a*b*f^2*(g*x+f)*GAMMA(1/n,I*d*(g*x+f)^n)/exp(I*c )/g^3/n/((I*d*(g*x+f)^n)^(1/n))+2^(-2-1/n)*b^2*exp(2*I*c)*f^2*(g*x+f)*GAMM A(1/n,-2*I*d*(g*x+f)^n)/g^3/n/((-I*d*(g*x+f)^n)^(1/n))+2^(-2-1/n)*b^2*f^2* (g*x+f)*GAMMA(1/n,2*I*d*(g*x+f)^n)/exp(2*I*c)/g^3/n/((I*d*(g*x+f)^n)^(1/n) )-2*I*a*b*exp(I*c)*f*(g*x+f)^2*GAMMA(2/n,-I*d*(g*x+f)^n)/g^3/n/((-I*d*(g*x +f)^n)^(2/n))+2*I*a*b*f*(g*x+f)^2*GAMMA(2/n,I*d*(g*x+f)^n)/exp(I*c)/g^3/n/ ((I*d*(g*x+f)^n)^(2/n))-2^(-1-2/n)*b^2*exp(2*I*c)*f*(g*x+f)^2*GAMMA(2/n,-2 *I*d*(g*x+f)^n)/g^3/n/((-I*d*(g*x+f)^n)^(2/n))-2^(-1-2/n)*b^2*f*(g*x+f)^2* GAMMA(2/n,2*I*d*(g*x+f)^n)/exp(2*I*c)/g^3/n/((I*d*(g*x+f)^n)^(2/n))+I*a*b* exp(I*c)*(g*x+f)^3*GAMMA(3/n,-I*d*(g*x+f)^n)/g^3/n/((-I*d*(g*x+f)^n)^(3/n) )-I*a*b*(g*x+f)^3*GAMMA(3/n,I*d*(g*x+f)^n)/exp(I*c)/g^3/n/((I*d*(g*x+f)^n) ^(3/n))+2^(-2-3/n)*b^2*exp(2*I*c)*(g*x+f)^3*GAMMA(3/n,-2*I*d*(g*x+f)^n)/g^ 3/n/((-I*d*(g*x+f)^n)^(3/n))+2^(-2-3/n)*b^2*(g*x+f)^3*GAMMA(3/n,2*I*d*(g*x +f)^n)/exp(2*I*c)/g^3/n/((I*d*(g*x+f)^n)^(3/n))
Time = 1.11 (sec) , antiderivative size = 648, normalized size of antiderivative = 0.76 \[ \int x^2 \left (a+b \sin \left (c+d (f+g x)^n\right )\right )^2 \, dx=\frac {\left (2 a^2+b^2\right ) g^3 n x^3+6 i a b e^{i c} (f+g x) \left (-i d (f+g x)^n\right )^{-3/n} \left (f^2 \left (-i d (f+g x)^n\right )^{2/n} \Gamma \left (\frac {1}{n},-i d (f+g x)^n\right )-(f+g x) \left (2 f \left (-i d (f+g x)^n\right )^{\frac {1}{n}} \Gamma \left (\frac {2}{n},-i d (f+g x)^n\right )-(f+g x) \Gamma \left (\frac {3}{n},-i d (f+g x)^n\right )\right )\right )-6 i a b e^{-i c} (f+g x) \left (i d (f+g x)^n\right )^{-3/n} \left (f^2 \left (i d (f+g x)^n\right )^{2/n} \Gamma \left (\frac {1}{n},i d (f+g x)^n\right )-(f+g x) \left (2 f \left (i d (f+g x)^n\right )^{\frac {1}{n}} \Gamma \left (\frac {2}{n},i d (f+g x)^n\right )-(f+g x) \Gamma \left (\frac {3}{n},i d (f+g x)^n\right )\right )\right )+3\ 2^{-\frac {3+n}{n}} b^2 e^{2 i c} (f+g x) \left (-i d (f+g x)^n\right )^{-3/n} \left (4^{\frac {1}{n}} f^2 \left (-i d (f+g x)^n\right )^{2/n} \Gamma \left (\frac {1}{n},-2 i d (f+g x)^n\right )-(f+g x) \left (2^{1+\frac {1}{n}} f \left (-i d (f+g x)^n\right )^{\frac {1}{n}} \Gamma \left (\frac {2}{n},-2 i d (f+g x)^n\right )-(f+g x) \Gamma \left (\frac {3}{n},-2 i d (f+g x)^n\right )\right )\right )+3\ 2^{-\frac {3+n}{n}} b^2 e^{-2 i c} (f+g x) \left (i d (f+g x)^n\right )^{-3/n} \left (4^{\frac {1}{n}} f^2 \left (i d (f+g x)^n\right )^{2/n} \Gamma \left (\frac {1}{n},2 i d (f+g x)^n\right )-(f+g x) \left (2^{1+\frac {1}{n}} f \left (i d (f+g x)^n\right )^{\frac {1}{n}} \Gamma \left (\frac {2}{n},2 i d (f+g x)^n\right )-(f+g x) \Gamma \left (\frac {3}{n},2 i d (f+g x)^n\right )\right )\right )}{6 g^3 n} \]
((2*a^2 + b^2)*g^3*n*x^3 + ((6*I)*a*b*E^(I*c)*(f + g*x)*(f^2*((-I)*d*(f + g*x)^n)^(2/n)*Gamma[n^(-1), (-I)*d*(f + g*x)^n] - (f + g*x)*(2*f*((-I)*d*( f + g*x)^n)^n^(-1)*Gamma[2/n, (-I)*d*(f + g*x)^n] - (f + g*x)*Gamma[3/n, ( -I)*d*(f + g*x)^n])))/((-I)*d*(f + g*x)^n)^(3/n) - ((6*I)*a*b*(f + g*x)*(f ^2*(I*d*(f + g*x)^n)^(2/n)*Gamma[n^(-1), I*d*(f + g*x)^n] - (f + g*x)*(2*f *(I*d*(f + g*x)^n)^n^(-1)*Gamma[2/n, I*d*(f + g*x)^n] - (f + g*x)*Gamma[3/ n, I*d*(f + g*x)^n])))/(E^(I*c)*(I*d*(f + g*x)^n)^(3/n)) + (3*b^2*E^((2*I) *c)*(f + g*x)*(4^n^(-1)*f^2*((-I)*d*(f + g*x)^n)^(2/n)*Gamma[n^(-1), (-2*I )*d*(f + g*x)^n] - (f + g*x)*(2^(1 + n^(-1))*f*((-I)*d*(f + g*x)^n)^n^(-1) *Gamma[2/n, (-2*I)*d*(f + g*x)^n] - (f + g*x)*Gamma[3/n, (-2*I)*d*(f + g*x )^n])))/(2^((3 + n)/n)*((-I)*d*(f + g*x)^n)^(3/n)) + (3*b^2*(f + g*x)*(4^n ^(-1)*f^2*(I*d*(f + g*x)^n)^(2/n)*Gamma[n^(-1), (2*I)*d*(f + g*x)^n] - (f + g*x)*(2^(1 + n^(-1))*f*(I*d*(f + g*x)^n)^n^(-1)*Gamma[2/n, (2*I)*d*(f + g*x)^n] - (f + g*x)*Gamma[3/n, (2*I)*d*(f + g*x)^n])))/(2^((3 + n)/n)*E^(( 2*I)*c)*(I*d*(f + g*x)^n)^(3/n)))/(6*g^3*n)
Time = 1.02 (sec) , antiderivative size = 819, normalized size of antiderivative = 0.96, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.091, Rules used = {3914, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int x^2 \left (a+b \sin \left (c+d (f+g x)^n\right )\right )^2 \, dx\) |
\(\Big \downarrow \) 3914 |
\(\displaystyle \frac {\int \left (f^2 \left (a+b \sin \left (d (f+g x)^n+c\right )\right )^2+(f+g x)^2 \left (a+b \sin \left (d (f+g x)^n+c\right )\right )^2-2 f (f+g x) \left (a+b \sin \left (d (f+g x)^n+c\right )\right )^2\right )d(f+g x)}{g^3}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {\frac {i a b e^{i c} (f+g x)^3 \Gamma \left (\frac {3}{n},-i d (f+g x)^n\right ) \left (-i d (f+g x)^n\right )^{-3/n}}{n}+\frac {2^{-2-\frac {3}{n}} b^2 e^{2 i c} (f+g x)^3 \Gamma \left (\frac {3}{n},-2 i d (f+g x)^n\right ) \left (-i d (f+g x)^n\right )^{-3/n}}{n}-\frac {2 i a b e^{i c} f (f+g x)^2 \Gamma \left (\frac {2}{n},-i d (f+g x)^n\right ) \left (-i d (f+g x)^n\right )^{-2/n}}{n}-\frac {2^{-1-\frac {2}{n}} b^2 e^{2 i c} f (f+g x)^2 \Gamma \left (\frac {2}{n},-2 i d (f+g x)^n\right ) \left (-i d (f+g x)^n\right )^{-2/n}}{n}+\frac {i a b e^{i c} f^2 (f+g x) \Gamma \left (\frac {1}{n},-i d (f+g x)^n\right ) \left (-i d (f+g x)^n\right )^{-1/n}}{n}+\frac {2^{-2-\frac {1}{n}} b^2 e^{2 i c} f^2 (f+g x) \Gamma \left (\frac {1}{n},-2 i d (f+g x)^n\right ) \left (-i d (f+g x)^n\right )^{-1/n}}{n}+\frac {1}{6} \left (2 a^2+b^2\right ) (f+g x)^3-\frac {1}{2} \left (2 a^2+b^2\right ) f (f+g x)^2+\frac {1}{2} \left (2 a^2+b^2\right ) f^2 (f+g x)-\frac {i a b e^{-i c} f^2 (f+g x) \left (i d (f+g x)^n\right )^{-1/n} \Gamma \left (\frac {1}{n},i d (f+g x)^n\right )}{n}+\frac {2^{-2-\frac {1}{n}} b^2 e^{-2 i c} f^2 (f+g x) \left (i d (f+g x)^n\right )^{-1/n} \Gamma \left (\frac {1}{n},2 i d (f+g x)^n\right )}{n}+\frac {2 i a b e^{-i c} f (f+g x)^2 \left (i d (f+g x)^n\right )^{-2/n} \Gamma \left (\frac {2}{n},i d (f+g x)^n\right )}{n}-\frac {2^{-1-\frac {2}{n}} b^2 e^{-2 i c} f (f+g x)^2 \left (i d (f+g x)^n\right )^{-2/n} \Gamma \left (\frac {2}{n},2 i d (f+g x)^n\right )}{n}-\frac {i a b e^{-i c} (f+g x)^3 \left (i d (f+g x)^n\right )^{-3/n} \Gamma \left (\frac {3}{n},i d (f+g x)^n\right )}{n}+\frac {2^{-2-\frac {3}{n}} b^2 e^{-2 i c} (f+g x)^3 \left (i d (f+g x)^n\right )^{-3/n} \Gamma \left (\frac {3}{n},2 i d (f+g x)^n\right )}{n}}{g^3}\) |
(((2*a^2 + b^2)*f^2*(f + g*x))/2 - ((2*a^2 + b^2)*f*(f + g*x)^2)/2 + ((2*a ^2 + b^2)*(f + g*x)^3)/6 + (I*a*b*E^(I*c)*f^2*(f + g*x)*Gamma[n^(-1), (-I) *d*(f + g*x)^n])/(n*((-I)*d*(f + g*x)^n)^n^(-1)) - (I*a*b*f^2*(f + g*x)*Ga mma[n^(-1), I*d*(f + g*x)^n])/(E^(I*c)*n*(I*d*(f + g*x)^n)^n^(-1)) + (2^(- 2 - n^(-1))*b^2*E^((2*I)*c)*f^2*(f + g*x)*Gamma[n^(-1), (-2*I)*d*(f + g*x) ^n])/(n*((-I)*d*(f + g*x)^n)^n^(-1)) + (2^(-2 - n^(-1))*b^2*f^2*(f + g*x)* Gamma[n^(-1), (2*I)*d*(f + g*x)^n])/(E^((2*I)*c)*n*(I*d*(f + g*x)^n)^n^(-1 )) - ((2*I)*a*b*E^(I*c)*f*(f + g*x)^2*Gamma[2/n, (-I)*d*(f + g*x)^n])/(n*( (-I)*d*(f + g*x)^n)^(2/n)) + ((2*I)*a*b*f*(f + g*x)^2*Gamma[2/n, I*d*(f + g*x)^n])/(E^(I*c)*n*(I*d*(f + g*x)^n)^(2/n)) - (2^(-1 - 2/n)*b^2*E^((2*I)* c)*f*(f + g*x)^2*Gamma[2/n, (-2*I)*d*(f + g*x)^n])/(n*((-I)*d*(f + g*x)^n) ^(2/n)) - (2^(-1 - 2/n)*b^2*f*(f + g*x)^2*Gamma[2/n, (2*I)*d*(f + g*x)^n]) /(E^((2*I)*c)*n*(I*d*(f + g*x)^n)^(2/n)) + (I*a*b*E^(I*c)*(f + g*x)^3*Gamm a[3/n, (-I)*d*(f + g*x)^n])/(n*((-I)*d*(f + g*x)^n)^(3/n)) - (I*a*b*(f + g *x)^3*Gamma[3/n, I*d*(f + g*x)^n])/(E^(I*c)*n*(I*d*(f + g*x)^n)^(3/n)) + ( 2^(-2 - 3/n)*b^2*E^((2*I)*c)*(f + g*x)^3*Gamma[3/n, (-2*I)*d*(f + g*x)^n]) /(n*((-I)*d*(f + g*x)^n)^(3/n)) + (2^(-2 - 3/n)*b^2*(f + g*x)^3*Gamma[3/n, (2*I)*d*(f + g*x)^n])/(E^((2*I)*c)*n*(I*d*(f + g*x)^n)^(3/n)))/g^3
3.3.72.3.1 Defintions of rubi rules used
Int[((g_.) + (h_.)*(x_))^(m_.)*((a_.) + (b_.)*Sin[(c_.) + (d_.)*((e_.) + (f _.)*(x_))^(n_)])^(p_.), x_Symbol] :> Module[{k = If[FractionQ[n], Denominat or[n], 1]}, Simp[k/f^(m + 1) Subst[Int[ExpandIntegrand[(a + b*Sin[c + d*x ^(k*n)])^p, x^(k - 1)*(f*g - e*h + h*x^k)^m, x], x], x, (e + f*x)^(1/k)], x ]] /; FreeQ[{a, b, c, d, e, f, g, h}, x] && IGtQ[p, 0] && IGtQ[m, 0]
\[\int x^{2} {\left (a +b \sin \left (c +d \left (g x +f \right )^{n}\right )\right )}^{2}d x\]
\[ \int x^2 \left (a+b \sin \left (c+d (f+g x)^n\right )\right )^2 \, dx=\int { {\left (b \sin \left ({\left (g x + f\right )}^{n} d + c\right ) + a\right )}^{2} x^{2} \,d x } \]
integral(-b^2*x^2*cos((g*x + f)^n*d + c)^2 + 2*a*b*x^2*sin((g*x + f)^n*d + c) + (a^2 + b^2)*x^2, x)
\[ \int x^2 \left (a+b \sin \left (c+d (f+g x)^n\right )\right )^2 \, dx=\int x^{2} \left (a + b \sin {\left (c + d \left (f + g x\right )^{n} \right )}\right )^{2}\, dx \]
\[ \int x^2 \left (a+b \sin \left (c+d (f+g x)^n\right )\right )^2 \, dx=\int { {\left (b \sin \left ({\left (g x + f\right )}^{n} d + c\right ) + a\right )}^{2} x^{2} \,d x } \]
1/3*a^2*x^3 + 1/6*b^2*x^3 - 1/2*b^2*integrate(x^2*cos(2*(g*x + f)^n*d + 2* c), x) + 2*a*b*integrate(x^2*sin((g*x + f)^n*d + c), x)
\[ \int x^2 \left (a+b \sin \left (c+d (f+g x)^n\right )\right )^2 \, dx=\int { {\left (b \sin \left ({\left (g x + f\right )}^{n} d + c\right ) + a\right )}^{2} x^{2} \,d x } \]
Timed out. \[ \int x^2 \left (a+b \sin \left (c+d (f+g x)^n\right )\right )^2 \, dx=\int x^2\,{\left (a+b\,\sin \left (c+d\,{\left (f+g\,x\right )}^n\right )\right )}^2 \,d x \]